﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aribaccio.Device
{
    public class AsciiSlave
    {
        /// <summary>
        /// 指令
        /// </summary>
        public string Command { get; set; }
        /// <summary>
        /// 回车结束符Ascii值
        /// </summary>
        public byte CarriageReturn { get { return 0x0D; } }
        /// <summary>
        /// 回车结束符字符串
        /// </summary>
        public string CarriageReturnStr { get { return "\r"; } }
        /// <summary>
        /// 是否等待结果
        /// </summary>
        public bool IsWaitResult { get; set; }

        /// <summary>
        /// 构造函数
        /// </summary>
        public AsciiSlave()
        {
            this.Command = string.Empty;
            this.IsWaitResult = true;
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="argCommand"></param>
        public AsciiSlave(string argCommand, bool argIsWaitResult = true)
        {
            this.Command = argCommand;
            this.IsWaitResult = argIsWaitResult;
        }
    }
}
